<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <base target="_self"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
    <script type="text/javascript" src="<%=path %>/jqGrid/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=path %>/jslib/jquery.validate.min.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/My97DatePicker/WdatePicker.js" defer="defer"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/jquery.form.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/additional-methods.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <c:if test="${requestScope.message!=null}">
		<script type="text/javascript">
 	 		     alert('<c:out value="${requestScope.message}"></c:out>');
 	 		     window.close();
 		</script>
	</c:if>
	
    <script type="text/javascript">
    $(document).ready(function(){
            $("#entry").click(function(){
                    checking();
			 		var rwfenpeiren = $("#rwfenpeiren").val();
			 		var wxfuzeren = $("#wxfuzeren").val();
			        window.returnValue = '{"rwfenpeiren":"'+rwfenpeiren+'","wxfuzeren":"'+wxfuzeren+'","state":"save"}';
			        window.close();
	         });
	  		 $("#center").click(function(){
	  		 		window.returnValue = '{"state":"close"}';
			        window.close();
	         });
	});
	
   	function checking(){
		var rwfenpeirenname = $.trim($("#rwfenpeirenname").val());
		var wxfuzerenname = $.trim($("#wxfuzerenname").val());
		
		if(rwfenpeirenname ==null || rwfenpeirenname == "" ){
			alert("任务分配人员不能为空！");
			$("#rwfenpeirenname").focus();
    		return false;
		}
		if(wxfuzerenname ==null || wxfuzerenname == "" ){
			alert("维修负责人不能为空！");
			$("#wxfuzerenname").focus();
    		return false;
		}
	}

	
	//选择人员
	function selectperson(id)
	{
		 var users = window.showModalDialog("<%=request.getContextPath() %>/resource/choose/selectUserByRole.jsp?roleid=", window, "dialogWidth:900px;status:no;dialogHeight:500px");
    	if (users != null) {
			$("#"+id+"name").val(users.username);
		    $("#"+id).val(users.userid);
		   }
	}
	

   </script>
 	<style type="text/css">
 		body{
 			background:#ffffff; background-image:url(images/);
 		}
   		html{
		    overflow-x: hidden;
			overflow-y: hidden;
		}  	
		.formTableNew textarea{border: 1px solid #999;padding: 5px;width: 760px;-moz-border-radius: 3px;border-radius: 3px;margin-bottom: 5px;color: #666;background: url(../images/input_bg.gif) repeat-x top;}
   </style>
  </head>
  
  <body>
<form id="pageFrom" action="" enctype="multipart/form-data" method="post">
        <input type="hidden" id="flag" name="flag" />
  		<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" class="formTableNew">
  		<input id="eid" type="hidden" name="tequipment.id" value=""/>
  			<tr>
  			  <td align="right">任务分配人：</td>
  			  <td align="left">
  			  	<input type="hidden" id="rwfenpeiren" name="rwfenpeiren" value="" />
  			    <input  type="text"  id="rwfenpeirenname" maxlength="50" name="rwfenpeirenname" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="<%=request.getSession().getAttribute("username").toString() %>" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">维修负责人：</td>
  			  <td align="left">
  			    <input type="hidden" id="wxfuzeren" name="wxfuzeren" value="" />
  			    <input  type="text"  id="wxfuzerenname" maxlength="50" name="wxfuzerenname" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  	<img src="<%=request.getContextPath() %>/web/images/form_icon_1.gif" style="cursor:hand; vertical-align: middle;" onclick="selectperson('wxfuzeren')" />
  			  </td>
  			</tr>
		</table>
		<table width="100%" border="0" align="center" class="formTableNew">
		  <tr>
			<td align="center">
		    	<input id="entry" type="button" value="提 交" class="form_bt_orange" />
		    	<input type="button" id="center" value="取 消" class="form_bt_grey" />
		    </td>
		  </tr>
		</table>
	<!--表单结束-->
	</form>
  </body>
</html>
